package com.xmy.cultivate.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xmy.cultivate.entity.AuthTeacherClassify;
import com.xmy.cultivate.mapper.AuthTeacherClassifyMapper;
import com.xmy.cultivate.service.IAuthTeacherClassifyService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 教师分类 服务实现类
 * </p>
 *
 * @author hpiggy
 * @since 2025-05-25
 */
@Service
public class AuthTeacherClassifyServiceImpl extends ServiceImpl<AuthTeacherClassifyMapper, AuthTeacherClassify> implements IAuthTeacherClassifyService {

    @Autowired
    AuthTeacherClassifyMapper authTeacherClassifyMapper;

    @Override
    public AuthTeacherClassify getTeacherClassifyByTeacherId(Long teacherId, Integer type) {
        AuthTeacherClassify authTeacherClassify = authTeacherClassifyMapper.selectOne(new QueryWrapper<AuthTeacherClassify>().eq("teacher_id", teacherId).eq("type", type).last("limit 1"));
        return authTeacherClassify;
    }

}
